package com.silverhaze.diamond.common.entity;


import com.silverhaze.commons.db.datasource.ObjectEntity;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Author: Ivan Babanin
 * © Lizard Software, 2008 y.
 */
@Entity()
@Table(name = "detailes")
public class Detail extends ObjectEntity {
    private static final long serialVersionUID = 2689127L;

    @Basic()
    private String name;

    @Basic()
    private String description;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String toString() {
        return name;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Detail detail = (Detail) o;

        if (!description.equals(detail.description)) return false;
        if (!name.equals(detail.name)) return false;

        return true;
    }

    public int hashCode() {
        int result;
        result = name.hashCode();
        result = 31 * result + description.hashCode();
        return result;
    }
}

